package com.example.infrastructure.api.person.vo;

import com.example.infrastructure.api.person.validation.annotation.EnumCheck;
import com.example.infrastructure.api.person.validation.annotation.Mobile;
import com.example.infrastructure.domain.person.aggregate.valueObject.Gender;
import lombok.Data;

import javax.validation.constraints.NotEmpty;

/**
 * TODO
 *
 * @author lxh
 * @date 2020/11/23 下午12:27
 **/
@Data
public class PersonVo {
    private String personId;

    @NotEmpty(message = "姓名不能为空！")
    private String name;

    @EnumCheck(message = "性别必须为MALE或FEMALE", enumClass = Gender.class)
    private String gender;

    @Mobile
    private String mobile;

    @NotEmpty(message = "所属部门不能为空！")
    private String orgId;

    private String type;

    public String getGender() {
        return gender != null ? gender.toUpperCase() : null;
    }
}
